<template>
  <view class="mine-container" :style="{ height: `${windowHeight}px` }">
    <!--顶部个人信息栏-->
    <view class="header-section">
      <view class="flex padding justify-between">
        <view class="flex align-center">
          <image
            v-if="!memberStore.userInfo.avatar"
            src="@/static/tabs/noLogin.png"
            class="cu-avatar xl round"
            style="background-color: white"
            mode="scaleToFill"
          />
          <image
            v-if="memberStore.userInfo.avatar"
            :src="memberStore.userInfo.avatar"
            class="cu-avatar xl round"
            mode="widthFix"
          >
          </image>
          <view v-if="name" class="user-info">
            <view class="u_title">
              用户名:{{ memberStore.userInfo.username }}
            </view>
            <view class="u_title">
              手机号:{{ memberStore.userInfo.mobile }}
            </view>
          </view>
        </view>
        <!-- <view class="flex align-center">
          <text style="font-size: 30rpx" @click="handlePersonal">个人信息</text>
          <view class="iconfont icon-right"></view>
        </view> -->
      </view>
    </view>

    <view class="content-section">
      <view class="menu-list">
        <view class="list-cell list-cell-arrow" @click="handleMyRegistration">
          <view class="menu-item-box">
            <text
              class="iconfont icon-wodedengji"
              style="color: #f6713e; margin-right: 5px"
            ></text>
            <view class="fontSize">我的登记</view>
          </view>
        </view>
        <view class="list-cell list-cell-arrow" @click="handleApplication">
          <view class="menu-item-box">
            <text
              class="iconfont icon-wodeshenqing"
              style="color: red; margin-right: 5px"
            ></text>
            <view class="fontSize">我的申请</view>
          </view>
        </view>
        <view class="list-cell list-cell-arrow" @click="handleClick">
          <view class="menu-item-box">
            <text
              class="iconfont icon-xiaochengxu"
              style="color: #37b238; margin-right: 5px"
            ></text>
            <view class="fontSize">关于小程序</view>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script setup>
import { useMemberStore } from "@/stores/modules/member";
const memberStore = useMemberStore();
const name = ref("小明");
const windowHeight = computed(() => uni.getSystemInfoSync().windowHeight - 50);

const handleMyRegistration = () => {
  uni.navigateTo({
    url: "/pages/MyRegistration/MyRegistration",
  });
};
const handleApplication = () => {
  uni.navigateTo({
    url: "/pages/MyApplication/MyApplication",
  });
};
function handleClick() {
  uni.reLaunch({
    url: "/pages/AboutPrograms",
  });
}
</script>

<style lang="scss" scoped>
.fontSize {
  font-size: 25rpx;
}
page {
  background-color: #f5f6f7;
}

.mine-container {
  width: 100%;
  height: 100%;

  .header-section {
    padding: 15px 15px 45px 15px;
    background-color: #3c96f3;
    color: white;

    .login-tip {
      font-size: 18px;
      margin-left: 10px;
    }

    .cu-avatar {
      border: 2px solid #eaeaea;

      .icon {
        font-size: 40px;
      }
    }

    .user-info {
      margin-left: 15px;

      .u_title {
        font-size: 30rpx;
      }
    }
  }

  .content-section {
    position: relative;
    top: -50px;

    .mine-actions {
      margin: 15px 15px;
      padding: 20px 0px;
      border-radius: 8px;
      background-color: white;

      .action-item {
        .icon {
          font-size: 28px;
        }

        .text {
          display: block;
          font-size: 13px;
          margin: 8px 0px;
        }
      }
    }
  }
}
</style>
